Ext.form.TextField.override({  
                initComponent: Ext.form.TextField.prototype.initComponent.createInterceptor(function(){  
                    //当不允许为空的时候，增加红色*
                    if (this.allowBlank === false && this.fieldLabel) {  
                        this.fieldLabel ="<font color=red size=2>*</font>"+this.fieldLabel;  
                    }  
                }),
                /*listeners : {  
		        		//render : this.updateTip,  
		       			change : function(n) {
		       				if(this.tips) {
		       				 this.getEl().dom.setAttribute("ext:qtip", this.el.dom.value); 
		       				}
		       			},
		       			autosize:function(n) {
		       				 this.getEl().dom.setAttribute("ext:qtip", this.el.dom.value); 
		       			}
   				 },*/
   				 applyEmptyText:Ext.form.TextField.prototype.applyEmptyText.createInterceptor(function(){ 
   				 	   if(this.rendered&&this.tips){  
   				 	   	   var tip ;
   				 	   	   if (this.xtype =='combo'||this.xtype =='lovcombo') {
   				 	   	   	 tip=this.lastSelectionText;
   				 	   	   } else {
   				 	   	   	 tip=this.value;
   				 	   	   }
   				 	   	   //增加tips提示
   						   this.getEl().dom.setAttribute("ext:qtip", tip);  
   						 }
   				 }),
   				 //长度提示时，增加现有长度的提示
   				 getErrors: function(value) {
			        var errors = Ext.form.TextField.superclass.getErrors.apply(this, arguments);
			        
			        value = Ext.isDefined(value) ? value : this.processValue(this.getRawValue());        
			        
			        if (Ext.isFunction(this.validator)) {
			            var msg = this.validator(value);
			            if (msg !== true) {
			                errors.push(msg);
			            }
			        }
			        
			        if (value.length < 1 || value === this.emptyText) {
			            if (this.allowBlank) {
			                
			                return errors;
			            } else {
			                errors.push(this.blankText);
			            }
			        }
			        
			        if (!this.allowBlank && (value.length < 1 || value === this.emptyText)) { 
			            errors.push(this.blankText);
			        }
			        
			        if (value.length < this.minLength) {
			            errors.push(String.format(this.minLengthText, this.minLength));
			        }
			        
			        if (value.length > this.maxLength) {
			            errors.push(String.format(this.maxLengthText, this.maxLength,value.length));
			        }
			        
			        if (this.vtype) {
			            var vt = Ext.form.VTypes;
			            if(!vt[this.vtype](value, this)){
			                errors.push(this.vtypeText || vt[this.vtype +'Text']);
			            }
			        }
			        
			        if (this.regex && !this.regex.test(value)) {
			            errors.push(this.regexText);
			        }
			        
			        return errors;
			    }
                
            });
Ext.form.ComboBox.override({
	setValue : function(v){
		var oldValue =this.value;
        var text = v;
        if(this.valueField){
            var r = this.findRecord(this.valueField, v);
            if(r){
                text = r.data[this.displayField];
            }else if(Ext.isDefined(this.valueNotFoundText)){
                text = this.valueNotFoundText;
            }
        }
        this.lastSelectionText = text;
        if(this.hiddenField){
            this.hiddenField.value = Ext.value(v, '');
        }
        Ext.form.ComboBox.superclass.setValue.call(this, text);
        this.value = v;
        if (oldValue !=v){
        	//增加aftersetvalue事件
        	this.fireEvent('aftersetvalue', this, oldValue, v);
        }
        return this;
    },
    initList : function(){
        if(!this.list){
            var cls = 'x-combo-list',
                listParent = Ext.getDom(this.getListParent() || Ext.getBody());

            this.list = new Ext.Layer({
                parentEl: listParent,
                shadow: this.shadow,
                cls: [cls, this.listClass].join(' '),
                constrain:false,
                zindex: this.getZIndex(listParent)
            });

            var lw = this.listWidth || Math.max(this.wrap.getWidth(), this.minListWidth);
            this.list.setSize(lw, 0);
            this.list.swallowEvent('mousewheel');
            this.assetHeight = 0;
            if(this.syncFont !== false){
                this.list.setStyle('font-size', this.el.getStyle('font-size'));
            }
            if(this.title){
                this.header = this.list.createChild({cls:cls+'-hd', html: this.title});
                this.assetHeight += this.header.getHeight();
            }

            this.innerList = this.list.createChild({cls:cls+'-inner'});
            this.mon(this.innerList, 'mouseover', this.onViewOver, this);
            this.mon(this.innerList, 'mousemove', this.onViewMove, this);
            this.innerList.setWidth(lw - this.list.getFrameWidth('lr'));

            if(this.pageSize){
                this.footer = this.list.createChild({cls:cls+'-ft'});
                this.pageTb = new Ext.PagingToolbar({
                    store: this.store,
                    pageSize: this.pageSize,
                    renderTo:this.footer
                });
                this.assetHeight += this.footer.getHeight();
            }

            if(!this.tpl){
            	//增加tips设置
                if (this.tips) {
                	this.tpl = '<tpl for="."><div class="'+cls+'-item" ext:qtip ="{'+this.displayField +'}">{' + this.displayField + '}</div></tpl>';
                } else {
                	this.tpl = '<tpl for="."><div class="'+cls+'-item">{' + this.displayField + '}</div></tpl>';
                }
            }

            
            this.view = new Ext.DataView({
                applyTo: this.innerList,
                tpl: this.tpl,
                singleSelect: true,
                selectedClass: this.selectedClass,
                itemSelector: this.itemSelector || '.' + cls + '-item',
                emptyText: this.listEmptyText,
                deferEmptyText: false
            });

            this.mon(this.view, {
                containerclick : this.onViewClick,
                click : this.onViewClick,
                scope :this
            });

            this.bindStore(this.store, true);

            if(this.resizable){
                this.resizer = new Ext.Resizable(this.list,  {
                   pinned:true, handles:'se'
                });
                this.mon(this.resizer, 'resize', function(r, w, h){
                    this.maxHeight = h-this.handleHeight-this.list.getFrameWidth('tb')-this.assetHeight;
                    this.listWidth = w;
                    this.innerList.setWidth(w - this.list.getFrameWidth('lr'));
                    this.restrictHeight();
                }, this);

                this[this.pageSize?'footer':'innerList'].setStyle('margin-bottom', this.handleHeight+'px');
            }
        }
    }
}); 

/**
 * override GridView
 *1. 对grid增加copy属性。默认为true。true使表格可以复制，false则表格不可以复制
 *2. 对列增加增加统一align控制 .配置在viewConfig中 cellAlign 表示所有列按该模式布局(设置columns中属性align可以覆盖掉该属性)
 *3. 对表头增加统一控制 配置在viewConfig中 headerAlign 表示所有列表头都按该 模式布局（设置headerAlign中属性align可以覆盖掉该属性） 
 *4.增加自动换行配置。默认所有表头自动换行，列不自动换行。增加对表头换控制（allowHeaderWrap）  增加对列换行控制(allowWrap) 
 *   配置为false，则不换行。配置在columns中可以覆盖viewConfig表中控制
 *5. 增加配置选项 cellTip
 */
Ext.grid.GridView.override({
   copy:true,
   addColTip:function(value, metaData, record, rowIndex, colIndex, store) {
    					  if (value!=null) {
              	         	metaData.attr ='ext:qtip ="'+value+'"'
    					  }
              	          return value
		}
   ,initTemplates : function() {
        var templates = this.templates || {},
            template, name,
            
            headerCellTpl = new Ext.Template(
                '<td class="x-grid3-hd x-grid3-cell x-grid3-td-{id} {css}" style="{style}">',
                    '<div {tooltip} {attr} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">', 
                        this.grid.enableHdMenu ? '<a class="x-grid3-hd-btn" href="#"></a>' : '',
                        '{value}',
                        '<img alt="" class="x-grid3-sort-icon" src="', Ext.BLANK_IMAGE_URL, '" />',
                    '</div>',
                '</td>'
            ),
        
            rowBodyText = [
                '<tr class="x-grid3-row-body-tr" style="{bodyStyle}">',
                    '<td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on">',
                        '<div class="x-grid3-row-body">{body}</div>',
                    '</td>',
                '</tr>'
            ].join(""),
        
            innerText = [
                '<table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',
                     '<tbody>',
                        '<tr>{cells}</tr>',
                        this.enableRowBody ? rowBodyText : '',
                     '</tbody>',
                '</table>'
            ].join("");
        if (this.copy ==true) {
        	this.cellTpl=new Ext.Template(
		        '<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} x-selectable {css}" style="{style}" tabIndex="0" {cellAttr}>',
		            '<div class="x-grid3-cell-inner x-grid3-col-{id}"  {isstyle} {attr}>{value}</div>',
		        '</td>'
    		)
        } else {
	         this.cellTpl=new Ext.Template(
			        '<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}" tabIndex="0" {cellAttr}>',
			            '<div class="x-grid3-cell-inner x-grid3-col-{id} x-unselectable" unselectable="on" {isstyle} {attr}>{value}</div>',
			        '</td>'
	   		 )
   		 }
        Ext.applyIf(templates, {
            hcell   : headerCellTpl,
            cell    : this.cellTpl,
            body    : this.bodyTpl,
            header  : this.headerTpl,
            master  : this.masterTpl,
            row     : new Ext.Template('<div class="x-grid3-row {alt}" style="{tstyle}">' + innerText + '</div>'),
            rowInner: new Ext.Template(innerText)
        });

        for (name in templates) {
            template = templates[name];
            
            if (template && Ext.isFunction(template.compile) && !template.compiled) {
                template.disableFormats = true;
                template.compile();
            }
        }

        this.templates = templates;
        this.colRe = new RegExp('x-grid3-td-([^\\s]+)', '');
    }
    ,getColumnStyle : function(colIndex, isHeader) {
        var colModel  = this.cm,
            colConfig = colModel.config,
            style     = isHeader ? '' : colConfig[colIndex].css || '';
            //align     = colConfig[colIndex].align;
        var align;
        if (isHeader ){
        	align =colConfig[colIndex].headerAlign||this.headerAlign||colConfig[colIndex].align||this.cellAlign
        } else {
        	align= colConfig[colIndex].align||this.cellAlign;
        }
          style += String.format("width: {0};", this.getColumnWidth(colIndex));
            
        
        if (colModel.isHidden(colIndex)) {
            style += 'display: none; ';
        }
        
        if (align) {
            style += String.format("text-align: {0};", align);
        }
        
        return style;
    }
    ,renderHeaders : function() {
        var colModel   = this.cm,
            templates  = this.templates,
            headerTpl  = templates.hcell,
            properties = {},
            colCount   = colModel.getColumnCount(),
            last       = colCount - 1,
            cells      = [],
            i, cssCls;
        
        for (i = 0; i < colCount; i++) {
            if (i == 0) {
                cssCls = 'x-grid3-cell-first ';
            } else {
                cssCls = i == last ? 'x-grid3-cell-last ' : '';
            }
            
            properties = {
                id     : colModel.getColumnId(i),
                value  : colModel.getColumnHeader(i) || '',
                style  : this.getColumnStyle(i, true),
                css    : cssCls,
                tooltip: this.getColumnTooltip(i)
            };
            
            if (colModel.config[i].align == 'right') {
                properties.istyle = 'padding-right: 16px;';
            } else {
                delete properties.istyle;
            }
            properties.istyle = properties.istyle||"";
            if (!(this.allowHeaderWrap ===false))  {
            	if (!(colModel.config[i].allowHeaderWrap===false)) {
           		properties.istyle =properties.istyle+"white-space:normal;";
            	}
            }
            cells[i] = headerTpl.apply(properties);
        }
        
        return templates.header.apply({
            cells : cells.join(""),
            tstyle: String.format("width: {0};", this.getTotalWidth())
        });
    }
    ,doRender : function(columns, records, store, startRow, colCount, stripe) {
        var templates = this.templates,
            cellTemplate = templates.cell,
            rowTemplate = templates.row,
            last = colCount - 1,
            tstyle = 'width:' + this.getTotalWidth() + ';',
            // buffers
            rowBuffer = [],
            colBuffer = [],
            rowParams = {tstyle: tstyle},
            
            len  = records.length,
            alt,
            column,
            record, i, j, rowIndex;

        //build up each row's HTML
        for (j = 0; j < len; j++) {
            record    = records[j];
            colBuffer = [];

            rowIndex = j + startRow;

            //build up each column's HTML
            for (i = 0; i < colCount; i++) {
            	var meta = {};
            	var column = columns[i];
            	colConfig = this.cm.config;
            	//如果作用的默认的renderer
            	if(column.renderer ==Ext.grid.Column.prototype.renderer){
            		if(this.cellTip===true){
            			if (!(colConfig[i].cellTip===false)){
            				column.renderer =this.addColTip;
            			}
            		}
            		if (colConfig[i].cellTip===true){
            			column.renderer =this.addColTip;
            		}
            	}
                
                if (this.allowWrap ===true) {
                	if (colConfig[i].allowWrap ===true){
                	    	meta.isstyle='style="white-space:normal;"';
                	}
                }
                meta.id    = column.id;
                meta.css   = i === 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : '');
                meta.attr  = meta.cellAttr = '';
                meta.style = column.style;
                meta.value = column.renderer.call(column.scope, record.data[column.name], meta, record, rowIndex, i, store);

                if (Ext.isEmpty(meta.value)) {
                    meta.value = '&#160;';
                }

                if (this.markDirty && record.dirty && typeof record.modified[column.name] != 'undefined') {
                    meta.css += ' x-grid3-dirty-cell';
                }

                colBuffer[colBuffer.length] = cellTemplate.apply(meta);
            }

            alt = [];
            //set up row striping and row dirtiness CSS classes
            if (stripe && ((rowIndex + 1) % 2 === 0)) {
                alt[0] = 'x-grid3-row-alt';
            }

            if (record.dirty) {
                alt[1] = ' x-grid3-dirty-row';
            }

            rowParams.cols = colCount;

            if (this.getRowClass) {
                alt[2] = this.getRowClass(record, rowIndex, rowParams, store);
            }

            rowParams.alt   = alt.join(' ');
            rowParams.cells = colBuffer.join('');

            rowBuffer[rowBuffer.length] = rowTemplate.apply(rowParams);
        }

        return rowBuffer.join('');
    }
    ,refreshRow: function(record) {
        var store     = this.ds,
            colCount  = this.cm.getColumnCount(),
            columns   = this.getColumnData(),
            last      = colCount - 1,
            cls       = ['x-grid3-row'],
            rowParams = {
                tstyle: String.format("width: {0};", this.getTotalWidth())
            },
            colBuffer = [],
            cellTpl   = this.templates.cell,
            rowIndex, row, column, meta, css, i;
        if (Ext.isNumber(record)) {
            rowIndex = record;
            record   = store.getAt(rowIndex);
        } else {
            rowIndex = store.indexOf(record);
        }
        
        //the record could not be found
        if (!record || rowIndex < 0) {
            return;
        }
        
        //builds each column in this row
        for (i = 0; i < colCount; i++) {
            column = columns[i];
            
            if (i == 0) {
                css = 'x-grid3-cell-first';
            } else {
                css = (i == last) ? 'x-grid3-cell-last ' : '';
            }
            
            meta = {
                id      : column.id,
                style   : column.style,
                css     : css,
                attr    : "",
                cellAttr: ""
            };
            colConfig = this.cm.config;
            //如果作用的默认的renderer
        	if(column.renderer ==Ext.grid.Column.prototype.renderer){
        		if(this.cellTip===true){
        			if (!(colConfig[i].cellTip===false)){
        				column.renderer =this.addColTip;
        			}
        		}
        		if (colConfig[i].cellTip===true){
        			column.renderer =this.addColTip;
        		}
        	}
            if (this.allowWrap ===true) {
                	if (colConfig[i].allowWrap ===true){
                	    	meta.isstyle='style="white-space:normal;"';
                	}
                }
            // Need to set this after, because we pass meta to the renderer
            meta.value = column.renderer.call(column.scope, record.data[column.name], meta, record, rowIndex, i, store);
            
            if (Ext.isEmpty(meta.value)) {
                meta.value = '&#160;';
            }
            
            if (this.markDirty && record.dirty && typeof record.modified[column.name] != 'undefined') {
                meta.css += ' x-grid3-dirty-cell';
            }
            
            colBuffer[i] = cellTpl.apply(meta);
        }
        
        row = this.getRow(rowIndex);
        row.className = '';
        
        if (this.grid.stripeRows && ((rowIndex + 1) % 2 === 0)) {
            cls.push('x-grid3-row-alt');
        }
        
        if (this.getRowClass) {
            rowParams.cols = colCount;
            cls.push(this.getRowClass(record, rowIndex, rowParams, store));
        }
        
        this.fly(row).addClass(cls).setStyle(rowParams.tstyle);
        rowParams.cells = colBuffer.join("");
        row.innerHTML = this.templates.rowInner.apply(rowParams);
        
        this.fireEvent('rowupdated', this, rowIndex, record);
    }
    ,getColumnWidth : function(column) {
        var columnWidth = this.cm.getColumnWidth(column),
            borderWidth = this.borderWidth;
        
        if (Ext.isNumber(columnWidth)) {
            if (Ext.isBorderBox || (Ext.isWebKit && !Ext.isSafari2&&!Ext.isChrome)) {
                return columnWidth + "px";
            } else {
                return Math.max(columnWidth - borderWidth, 0) + "px";
            }
        } else {
            return columnWidth;
        }
    }
});

/* 增加x滚动行(scrollX)  y滚动行（scrollY） 分别控制  开始*/
Ext.Element.addMethods(function(){
	return {
	   setOverflowX:function(v){
	   	   var dom = this.dom;
	   	    if(v=='auto' && Ext.isMac && Ext.isGecko2){ 
                dom.style.overflowX = 'hidden';
                (function(){dom.style.overflowX = 'auto';}).defer(1);
            }else{
                dom.style.overflowX = v;
            }
	   },
	   setOverflowY:function(v){
	   	   var dom = this.dom;
	   	    if(v=='auto' && Ext.isMac && Ext.isGecko2){ 
                dom.style.overflowY = 'hidden';
                (function(){dom.style.overflowY = 'auto';}).defer(1);
            }else{
                dom.style.overflowY = v;
            }
	   }
	}
}());
Ext.BoxComponent.override({
    afterRender : function(){
        Ext.BoxComponent.superclass.afterRender.call(this);
        if(this.resizeEl){
            this.resizeEl = Ext.get(this.resizeEl);
        }
        if(this.positionEl){
            this.positionEl = Ext.get(this.positionEl);
        }
        this.boxReady = true;
        Ext.isDefined(this.autoScroll) && this.setAutoScroll(this.autoScroll);
        Ext.isDefined(this.scrollX) && this.setScrollX(this.scrollX);
        Ext.isDefined(this.scrollY) && this.setScrollY(this.scrollY);
        this.setSize(this.width, this.height);
        if(this.x || this.y){
            this.setPosition(this.x, this.y);
        }else if(this.pageX || this.pageY){
            this.setPagePosition(this.pageX, this.pageY);
        }
    },
    setScrollX : function(scroll){
        if(this.rendered){
            this.getContentTarget().setOverflowX(scroll ? 'auto' : '');
        }
        this.autoScroll = scroll;
        return this;
    },
    setScrollY : function(scroll){
        if(this.rendered){
            this.getContentTarget().setOverflowY(scroll ? 'auto' : '');
        }
        this.autoScroll = scroll;
        return this;
    }
});
/* 增加x滚动行(scrollX)  y滚动行（scrollY） 分别控制  结束*/


Ext.tree.TreeLoader.override({
	/**
	 * 为树节点增加root选项的设置。设置root选项后，数据选取o[root]的数据
	 * @param {} response
	 * @param {} node
	 * @param {} callback
	 * @param {} scope
	 */
	processResponse : function(response, node, callback, scope){
        var json = response.responseText;
        try {
            var o = response.responseData || Ext.decode(json);
            if (this.root){
            	o =o[this.root]||o;
            }
            node.beginUpdate();
            for(var i = 0, len = o.length; i < len; i++){
                var n = this.createNode(o[i]);
                if(n){
                    node.appendChild(n);
                }
            }
            node.endUpdate();
            this.runCallback(callback, scope || node, [node]);
        }catch(e){
            this.handleFailure(response);
        }
    }
});

//重写Ext.PagingToolbar
Ext.PagingToolbar.override({
	initComponent : function(){
		var T = Ext.Toolbar;
		var storeSize =this.storeSize||[[20,20],[50,50],[100,100],[200,200],[500,500],[1000,1000]];
        var pagingItems = [this.first = new T.Button({
            tooltip: this.firstText,
            overflowText: this.firstText,
            iconCls: 'x-tbar-page-first',
            disabled: true,
            handler: this.moveFirst,
            scope: this
        }), this.prev = new T.Button({
            tooltip: this.prevText,
            overflowText: this.prevText,
            iconCls: 'x-tbar-page-prev',
            disabled: true,
            handler: this.movePrevious,
            scope: this
        }), '-', this.beforePageText,
        this.inputItem = new Ext.form.NumberField({
            cls: 'x-tbar-page-number',
            allowDecimals: false,
            allowNegative: false,
            enableKeyEvents: true,
            selectOnFocus: true,
            submitValue: false,
            listeners: {
                scope: this,
                keydown: this.onPagingKeyDown,
                blur: this.onPagingBlur
            }
        }), this.afterTextItem = new T.TextItem({
            text: String.format(this.afterPageText, 1)
        }), '-', this.next = new T.Button({
            tooltip: this.nextText,
            overflowText: this.nextText,
            iconCls: 'x-tbar-page-next',
            disabled: true,
            handler: this.moveNext,
            scope: this
        }), this.last = new T.Button({
            tooltip: this.lastText,
            overflowText: this.lastText,
            iconCls: 'x-tbar-page-last',
            disabled: true,
            handler: this.moveLast,
            scope: this
        }), '-', this.refresh = new T.Button({
            tooltip: this.refreshText,
            overflowText: this.refreshText,
            iconCls: 'x-tbar-loading',
            handler: this.doRefresh,
            scope: this
        }),'-',new Ext.form.Label({text:'每页'}),new Ext.Spacer({width:10}),this.changeSize=new Ext.form.ComboBox({
            triggerAction:'all'
            ,editable:false
            ,store:storeSize
            ,width:60
            ,listeners:{
               select:function( combo, record, index ){
               	    var value =combo.getValue();
               	    if (this.pageSize !=value) {
               	    	this.store.limit=value;
               	    	this.pageSize=value;
               	    	this.doLoad(0);
               	    }
               }
               ,scope:this
            }
        }),new Ext.Spacer({width:10}),new Ext.form.Label({text:'条',style:{margin:'0 10 0 10'}})];
		this.changeSize.setValue(this.pageSize);
		this.store.limit=this.pageSize;
        var userItems = this.items || this.buttons || [];
        if (this.prependButtons) {
            this.items = userItems.concat(pagingItems);
        }else{
            this.items = pagingItems.concat(userItems);
        }
        delete this.buttons;
        if(this.displayInfo){
            this.items.push('->');
            this.items.push(this.displayItem = new T.TextItem({}));
        }
        Ext.PagingToolbar.superclass.initComponent.call(this);
        this.addEvents(
            'change',
            'beforechange'
        );
        this.on('afterlayout', this.onFirstLayout, this, {single: true});
        this.cursor = 0;
        this.bindStore(this.store, true);
    }
	
});

Ext.MessageBox.showError =  function(title,error){
	if (error!=null) {
     var  serror ='<p>'+error.replace(/\r\n/g,'</p><p>')+'</p>';
     new Ext.Window({
		title : '错误:'+title,
		closeAction : 'close',
		modal : true,
		width : 500,
		height :400,
		resizable:true,
		buttonAlign:'center',
		autoScroll:true,
		html:serror,
		minButtonWidth :60,
		maximizable:true,
		buttons:[{
			xtype:'button',
			text:'确定',
			handler:function(btn){
				this.ownerCt.ownerCt.destroy();
			}
		}]
		}).show();
	}
}

// ajax回调函数处理系统退出  
Ext.Ajax.on('requestcomplete',checkUserSessionStatus, this);     
Ext.Ajax.on('requestexception',requestexception, this);  
function requestexception(conn,response,options){
	if (response.isTimeout){
		var title ="";
		if (options.request&&options.request.scope&&options.request.scope.operate&&options.request.scope.operate.title) {
			title=options.request.scope.operate.title;
		}
		MsgTip.msg({msg:'['+title+']访问超时!请重试',pos:'center',type:'error'});
	} else 
	Ext.Msg.showError(response.statusText,response.responseText);
}
function checkUserSessionStatus(conn,response,options){     
    //Ext重新封装了response对象     
	var page =Ext.decode(response.responseText);
    if (response.getResponseHeader){
	    if(response.getResponseHeader('sessionstatus')){     
	        Ext.Msg.alert('提示','您的登录已超时，点击进入登陆界面！',function(){window.location.href="bssextend.jsp" ; });  
	         
	    }
	    if(page !=null){
		    if (page.status&&page.status!='200'){
		     Ext.Msg.showError('',page.info);
	    }
    }
    }
}  

/**
 * 金钱格式化如:323123.1 格式化后为 323,123.10 
 * @param {} v
 * @return {}
 */
Ext.util.Format.chMoney = function(v) {
            v = (Math.round((v-0)*100))/100;
            v = (v == Math.floor(v)) ? v + ".00" : ((v*10 == Math.floor(v*10)) ? v + "0" : v);
            v = String(v);
            var ps = v.split('.'),
                whole = ps[0],
                sub = ps[1] ? '.'+ ps[1] : '.00',
                r = /(\d+)(\d{3})/;
            while (r.test(whole)) {
                whole = whole.replace(r, '$1' + ',' + '$2');
            }
            v = whole + sub;
            if (v.charAt(0) == '-') {
                return '-' + v.substr(1);
            }
            return   v;
        }
